[ Home ] [ Authors ] [ Index ] [ Abbreviations ]

Tycho Key Bindings

Text interfaces (entry boxes and text editors) in Tycho use emacs conventions (for the most part) for key bindings.

Generic Bindings

The following key bindings apply to virtually all interactive text widgets in Tycho, including entry boxes in dialogs and text widgets in editors.

Navigation

C-a
go to the beginning of the line
C-b
backward one character
M-b
backward one word
C-e
go to the end of the line
C-f
forward one character
M-f
forward one word

Modifying text

Delete, C-h, and Backspace all erase the previous character, unless there is a selection, in which case they erase the selection. M-Delete, M-C-h, and M-BackSpace behave the same way, except that they erase a word at a time. In addition, the following bindings apply:

C-d
delete the next character
M-d
forward erase one word
C-k
erase to the end of the line (save to clipboard)
C-w
erase the selection
M-w
copy the selection to the clipboard
C-y
yank from the clipboard and insert at cursor
C-/
select the entire contents
C-\
clear any selection

Commands that delete characters will save them to the clipboard, so they can be recovered with C-y. Any set of continguous character deletions are collected in the clipboard.

Bindings for Entry Boxes and Dialogs

Entry boxes have all the generic bindings plus one more:

C-u
delete all the text in the entry box
In addition, most dialog boxes support the following:
Escape
dismiss the dialog, ignoring it
Return
dismiss the dialog, executing whatever
Space
invoke a button
Tab
move from one item to another

Bindings for Text Editors

Text editors (any multi-line editable text widget) have all the generic bindings plus a few more.

Changing Text

C-o
open a line of text below the insert cursor
C-x u
undo the last change
M-q
fill selected region or current paragraph
C-x f
change the right column used for the fill
C-x .
change the prefix characters used by the fill

The fill capability requires some explanation.

Filling Text

The "Fill Region" command fills text so that the lines are approximately of equal length and line breaks occur on word boundaries. It can optionally add a prefix to each filled line (for example a comment character), and typically does so in language-specific editors, which are derived from the basic editor. If a region of text has been selected, then it fills that region. Otherwise, it fills the paragraph that contains the insertion cursor. A paragraph is bounded by a blank line before and after, or possibly a line with only the comment character.

Navigation

The emacs-like bindings for moving around in a multi-line text widget are:

C-l
center the insert cursor on the screen
C-n
down one line
C-p
up one line
C-r
search backwards
C-s
search forwards
C-v
forward one page
M-v
backward one page
M-<
move to the top of the document
M->
move to the bottom of the document

Other capabilities for moving around in a text document are simply those implemented in the text widget in Tk. Thus, the following documentation is copied from the Tk text man page, written by John Ousterhout, with only minor modifications. Note that it is fairly common to redefine some of these bindings in the window manager to perform window manager functions. In this case, Tycho will never see the bindings, and they will not appear to work.

"The Left and Right keys move the insertion cursor one character to the left or right; they also clear any selection in the text. If Left or Right is typed with the Shift key down, then the insertion cursor moves and the selection is extended to include the new character. Control-Left and Control-Right move the insertion cursor by words, and Control-Shift-Left and Control-Shift-Right move the insertion cursor by words and also extend the selection.

The Up and Down keys move the insertion cursor one line up or down and clear any selection in the text. If Up or Right is typed with the Shift key down, then the insertion cursor moves and the selection is extended to include the new lines. Control-Up and Control-Down move the insertion cursor by paragraphs (groups of lines separated by blank lines), and Control-Shift-Up and Control-Shift-Down move the insertion cursor by paragraphs and also extend the selection.

The Next (Page up) and Prior (Page down) keys move the insertion cursor forward or backwards by one screenful and clear any selection in the text. If the Shift key is held down while Next or Prior is typed, then the selection is extended to include the new pages.

Home and Control-a move the insertion cursor to the beginning of its line and clear any selection in the widget. Shift-Home moves the insertion cursor to the beginning of the line and also extends the selection to that point.

End and Control-e move the insertion cursor to the end of the line and clear any selection in the widget. Shift-End moves the cursor to the end of the line and extends the selection to that point.

Control-Home and Meta-< move the insertion cursor to the beginning of the text and clear any selection in the widget. Control-Shift-Home moves the insertion cursor to the beginning of the text and also extends the selection to that point.

Control-End and Meta-> move the insertion cursor to the end of the text and clear any selection in the widget. Control-Shift-End moves the cursor to the end of the text and extends the selection to that point.

The F16 key (labeled Copy on many Sun workstations) or Meta-w copies the selection in the widget to the clipboard, if there is a selection.

The F20 key (labeled Cut on many Sun workstations) or Control-w copies the selection in the widget to the clipboard and deletes the selection. If there is no selection in the widget then these keys have no effect.

The F18 key (labeled Paste on many Sun workstations) or Control-y inserts the contents of the clipboard at the position of the insertion cursor."

Mouse Navigation

The interaction of the mouse with text is simply that implemented in the text widget in Tk. Thus, the following documentation is again copied from the man page for the text widget, written by John Ousterhout, with minor editing.

"Pressing mouse button 1 in an text positions the insertion cursor just before the character underneath the mouse cursor and sets the input focus to this widget. Dragging with mouse button 1 strokes out a selection between the insertion cursor and the character under the mouse.

If you double-click mouse button 1 then the word under the mouse cursor will be selected, the insertion cursor will be positioned at the beginning of the word, and dragging the mouse will stroke out a selection whole words at a time. [Note that in some derived classes, double clicking activates a hypertext link.]

If you triple-click mouse button 1 then the line under the mouse cursor will be selected, the insertion cursor will be positioned at the beginning of the line, and dragging the mouse will stroke out a selection whole line at a time.

The ends of the selection can be adjusted by dragging with mouse button 1 while the shift key is down; this will adjust the end of the selection that was nearest to the mouse cursor when button 1 was pressed. If the button is double-clicked before dragging then the selection will be adjusted in units of whole words; if it is triple-clicked, then the selection will be adjusted in units of whole lines.

Clicking mouse button 1 with the Control key down will reposition the insertion cursor without affecting the selection.

The view in the widget can be adjusted by dragging with mouse button 2. If mouse button 2 is clicked without moving the mouse, the selection is copied into the text at the position of the insertion cursor. The Insert key also inserts the selection.


Copyright © 1996, The Regents of the University of California. All rights reserved.
Last updated: 96/04/11, comments to: eal@eecs.berkeley.edu